<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateQuizzesTable extends Migration
{
    const TABLE = 'quizzes';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create(static::TABLE, function (Blueprint $table) {
            $table->uuid('id');
            $table->uuid('activity_id');
            $table->unsignedTinyInteger('type'); // 类型，单选，多选...
            $table->string('title'); // 标题，题干
            $table->text('configurations'); // 配置 json，一期的关联题型 以及 以后的扩战
            $table->text('validations'); // 验证规则 json

            $table->timestamps();
            $table->softDeletes();
            $table->primary('id');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists(static::TABLE);
    }
}
